﻿using DMSkin.Core.MVVM;
using DMSkin.WeChat.API;
using DMSkin.WeChat.Model;
using DMSkin.WeChat.View;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace DMSkin.WeChat.ViewModel
{
    public class ChatListPageViewModel : ViewModelBase
    {
        private readonly static ObservableCollection<Message> messages1 = new ObservableCollection<Message>()
        {
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Othe", Imge = "/Image/head.jpg"},
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Othe", Imge = "/Image/head.jpg"},
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "也许，很久以后你会懂: 像我这般倔强的人，是要鼓起多大的勇气才会求你别丢下我，又是憋着多大一股劲才会彻底把你赶出维度生活。走得最急的是最美的风景；伤得最深的是最真的感情。", Type = "Othe", Imge = "/Image/head.jpg"}
        };

        private readonly static ObservableCollection<Message> messages2 = new ObservableCollection<Message>()
        {
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Othe", Imge = "/Image/Head/head1.jpg"},
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Othe", Imge = "/Image/Head/head1.jpg"},
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Self", Imge = "/Image/head.jpg"},
            new Message(){Mess = "我们不停的翻弄着回忆，却再也找不回曾经的自己，我们不停挥霍着青春，却再也留不住青春岁月。", Type = "Othe", Imge = "/Image/Head/head1.jpg"}
        };

        /// <summary>
        /// 聊天列表
        /// </summary>
        private List<Friend> friends = new List<Friend>()
        {
            new Friend(){ Date="19:00", Message="新的一天，早上好！", Messages = messages1, Username = "张三", Source="Image/head.jpg", Visible= Visibility.Visible},
            new Friend(){ Date="19/02/13", Message="咋回事啊，老弟！", Messages = messages2, Username = "李四", Source="Image/Head/head1.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="19/03/19", Message="我也喜欢这个？", Username = "王五", Source="Image/Head/head2.jpg", Visible= Visibility.Visible},
            new Friend(){ Date="20/09/29", Message="WPF这个技术，好用吗？", Username = "马六", Source="Image/Head/head3.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="14:00", Message="阿西吧你，流弊了。", Username = "阿七", Source="Image/Head/head4.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="20/12/12", Message="晚上好啊呀。", Username = "钱八", Source="Image/Head/head5.jpg", Visible= Visibility.Visible},
            new Friend(){ Date="19:00", Message="新的一天，早上好！", Username = "张三", Source="Image/head.jpg", Visible= Visibility.Visible},
            new Friend(){ Date="19/02/13", Message="咋回事啊，老弟！", Username = "李四", Source="Image/Head/head1.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="19/03/19", Message="我也喜欢这个？", Username = "王五", Source="Image/Head/head2.jpg", Visible= Visibility.Visible},
            new Friend(){ Date="20/09/29", Message="WPF这个技术，好用吗？", Username = "马六", Source="Image/Head/head3.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="14:00", Message="阿西吧你，流弊了。", Username = "阿七", Source="Image/Head/head4.jpg", Visible= Visibility.Hidden},
            new Friend(){ Date="20/12/12", Message="晚上好啊呀。", Username = "钱八", Source="Image/Head/head5.jpg", Visible= Visibility.Visible}
        };

        public List<Friend> Friends
        {
            get { return friends; }
            set
            {
                friends = value;
                OnPropertyChanged("Friends");
            }
        }

        /// <summary>
        /// 当前页面
        /// </summary>
        private Page currentPage = new EmptyPage();

        public Page CurrentPage
        {
            get { return currentPage; }
            set
            {
                currentPage = value;
                OnPropertyChanged("CurrentPage");
            }
        }
    }
}
